package com.cskaoyan.app.util;

public class StringsUtil {
    public static boolean isEmpty(String s) {
        return s == null || "".equals(s);
    }

    public static String getOrderClause(String sort, String order) {
        if (!StringsUtil.isEmpty(sort) && order.matches("asc|desc|ASC|DESC")) {
            return sort + " " + order;
        }
        return null;
    }

    public static String getConcat(String target) {
        if (!StringsUtil.isEmpty(target)) {
            return "%" + target + "%";
        }
        return null;
    }
}
